﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace websitev2.Controllers
{
    public class ErrorsController : Controller
    {
        public ActionResult General(Exception exception)
        {
            try
            {
                StartStop.ServiceResources.ErrorEvent oError = new StartStop.ServiceResources.ErrorEvent();
                oError.ErrorMessage = exception.Message;
                oError.ErrorFrom = StartStop.ServiceResources.ErrorEvent.ErrorOriginatedFrom.UserSite;
                oError.ErrorLevel = StartStop.ServiceResources.ErrorEvent.ErrorLevelType.NotSoCritical;
                oError.ErrorDetail = exception.InnerException.Message.ToString();
                StartStop.Helpers.EventLog.LogError(oError); 
            }
            catch { }
            

            return View("Exception", exception);
        }

        public ActionResult Http404()
        {
            return View();
        }

        public ActionResult Http403()
        {
            return View();
        }

        public ActionResult AppError()
        {
            return View(); 
        }

    }
}
